package com.lhy.common.web.java8time;

import com.lhy.common.web.util.LocalDateTimeUtil;
import org.springframework.core.convert.converter.Converter;

import java.time.LocalDateTime;

/**
 * 时间参数接收转换器，将字符串转为时间类型
 */
public class StringToLocalDateTimeConverter implements Converter<String, LocalDateTime> {

    @Override
    public LocalDateTime convert(String s) {
        return LocalDateTimeUtil.parseTime(s);
    }
}
